<extend name="Public/layout"/>

<block name="body">
    <style>
        .modal .row .col-xs-12 {
            padding: 0 !important;
        }

        .nav-tabs-custom > .nav-tabs > li > a {
            padding: 10px 30px;
        }

        .modal .close {
            display: block !important;
            margin-right: 15px;
        }

        .modal-body {
            padding: 0 15px;
        }

        .modal .nav-tabs-custom.flat {
            margin-bottom: 0;
        }

        .modal .tab-footer {
            display: none;
        }
    </style>
    <?php $showFieldsConditons=array(1,3);?>
    <style>
        input.form-control[readonly], .form-control[disabled], .form-control[readonly], fieldset[disabled] .form-control, .form-control-readonly {
            background: #ffffff;
            border: none;
            padding-left: 0;
            height: auto;
            resize: none;
        }

        div.form-control-readonly {
            white-space: pre-wrap;
        }

        .datetimepicker table tr td.active:active, .datetimepicker table tr td.active:hover:active, .datetimepicker table tr td.active.disabled:active, .datetimepicker table tr td.active.disabled:hover:active, .datetimepicker table tr td.active.active, .datetimepicker table tr td.active:hover.active, .datetimepicker table tr td.active.disabled.active, .datetimepicker table tr td.active.disabled:hover.active, .datetimepicker table tr td span.active:active, .datetimepicker table tr td span.active:hover:active, .datetimepicker table tr td span.active.disabled:active, .datetimepicker table tr td span.active.disabled:hover:active, .datetimepicker table tr td span.active.active, .datetimepicker table tr td span.active:hover.active, .datetimepicker table tr td span.active.disabled.active, .datetimepicker table tr td span.active.disabled:hover.active {
            background-color: #3c8dbc;
            border-radius: 5px;
        }
    </style>
    <div class="row js-form-box" id="{$widgetId}">
        <form class="form-horizontal" action="{:U('count')}" method="get" id="data_form"
              autocomplete="off">
            <div class="col-xs-12">
                <div class="nav-tabs-custom flat">
                    <div class="tab-content no-padding">
                        <div class='tab-pane active' id="tab{$key}">
                            <div class="box-body" style="max-width:900px;">

                                <div class="form-group" style="padding: 7px 0 0 15px;">
                                   
                                    <div class="input-group date" style="width:100px;float: left;">
                                        <div class="input-group-addon"><i class="fa fa-calendar"></i></div>
                                        <input type="hidden" name="start_time" class="text date"
                                               value="{:I('get.start_time')}"/>
                                        <input style="width: auto;" type="text" data-name="start_time"
                                               class="form-control date datepicker" value="{:I('get.start_time')}"
                                               placeholder="请选择开始日期"
                                               data-type="date"/>
                                    </div>
                                    <div class="input-group date" style="width:100px;float: left;">
                                        <div class="input-group-addon"><i class="fa fa-calendar"></i></div>
                                        <input type="hidden" name="end_time" class="text date"
                                               value="{:I('get.end_time')}"/>
                                        <input style="width: auto;" type="text" data-name="end_time"
                                               class="form-control date datepicker" value="{:I('get.end_time')}"
                                               placeholder="请选择结束日期"
                                               data-type="date"/>
                                    </div>
                                    <button type="submit" class="btn btn-flat _dt_btns_ btn-default" data-callback="form" data-param="">
                                        搜索
                                    </button>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-2 control-label" data-name="{$field['name']}">订单支付总额</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" name="{$field.name}"
                                               value="{$company['total_order_money']}" readonly="readonly">
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-2 control-label" data-name="{$field['name']}">佣金总额</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" name="{$field.name}"
                                               value="{$company['total_commisson_money']}" readonly="readonly">
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-2 control-label" data-name="{$field['name']}">已结算佣金</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" name="{$field.name}"
                                               value="{$company['yjs_commisson_money']}" readonly="readonly">
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-2 control-label" data-name="{$field['name']}">未结算佣金</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" name="{$field.name}"
                                               value="{$company['wjs_commisson_money']}" readonly="readonly">
                                    </div>
                                </div>
                                
                                
                                <!-- <div class="form-group">
                                    <label class="col-sm-2 control-label" data-name="{$field['name']}">已发放红包金额</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" name="{$field.name}"
                                               value="{$company['total_red_packets']}" readonly="readonly">
                                    </div>
                                </div> -->
                                
                                <div class="form-group">
                                    <label class="col-sm-2 control-label" data-name="{$field['name']}">总提现金额</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" name="{$field.name}"
                                               value="{$company['total_cash']}" readonly="readonly">
                                    </div>
                                </div>
                                
                                <div class="form-group">
                                    <label class="col-sm-2 control-label" data-name="{$field['name']}">已发放提现金额</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" name="{$field.name}"
                                               value="{$company['yf_total_cash']}" readonly="readonly">
                                    </div>
                                </div>
                                
                                <div class="form-group">
                                    <label class="col-sm-2 control-label" data-name="{$field['name']}">未发放提现金额</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" name="{$field.name}"
                                               value="{$company['wf_total_cash']}" readonly="readonly">
                                    </div>
                                </div>
                                
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>

    <script>
        $(function () {
            $('.form-control.date.datepicker').change(function () {
                $(this).prev().val($(this).val());
            });

            $('#data_form').find('.datepicker').each(function () {
                var $this = $(this);
                var dateType = $(this).attr('data-type');
                var handle = "datepicker";
                var format = "yyyy-mm-dd";
                var options = {
                    language: 'zh-CN',
                    autoclose: true,
                    templates: {
                        leftArrow: '<i class="fa fa-caret-square-o-left"></i>',
                        rightArrow: '<i class="fa fa-long-arrow-right"></i>'
                    },
                }
                switch (dateType) {
                    case 'timestamp':
                    case 'datetime':
                        format = "yyyy-mm-dd hh:ii";
                        handle = 'datetimepicker';
                        break;
                    case 'date':
                        format = "yyyy-mm-dd";
                        handle = 'datepicker';
                        break;
                }
                options.format = format;
                var fieldName = $this.attr('data-name');
                $this[handle](options)
                    .on('changeDate,change', function (e) {
                        var value = $(e.currentTarget).val();
                        $('input[name=' + fieldName + ']').val(value);
                    });
            });
        });
    </script>
</block>